package cn.kooki.app.duobao.util.manager;

import android.database.Observable;

import cn.kooki.app.duobao.data.Bean.Index.GoodsItem;
import cn.kooki.app.duobao.data.Bean.Result.ResultItem;

/**
 * Created by xiong on 2015/11/28.
 */
public class CountDownObservable extends Observable<CountDownObserver> {

    public void notifyChanged(GoodsItem item) {
        synchronized(mObservers) {
            // since onChanged() is implemented by the app, it could do anything, including
            // removing itself from {@link mObservers} - and that could cause problems if
            // an iterator is used on the ArrayList {@link mObservers}.
            // to avoid such problems, just march thru the list in the reverse order.
            for (int i = mObservers.size() - 1; i >= 0; i--) {
                mObservers.get(i).onChanged(item);
            }
        }
    }

}
